package com.hancheng.commoncloud.framework.contant;

import java.math.BigDecimal;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 常量集合
 */
public class Constants {

    /**
     * 字符集ISO-8859-1
     */
    public static final Charset ISO_8859_1 = StandardCharsets.ISO_8859_1;

    /**
     * 字符集GBK
     */
    public static final Charset GBK = Charset.forName("GBK");

    /**
     * 字符集utf-8
     */
    public static final Charset UTF_8 = StandardCharsets.UTF_8;

    /**
     * Auth-Token
     */
    public static final String AUTH_TOKEN = "Auth-Token";

    /**
     * 日志ID（每次请求不同的ID，方便跟踪）
     */
    public static final String MDC_REQUEST_ID = "trackId";

    /**
     * 线程池用于异步执行
     */
    public static final ExecutorService EXECUTOR_SERVICE = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 2 + 1);

    /**
     * http请求
     */
    public static final String HTTP = "http://";

    /**
     * https请求
     */
    public static final String HTTPS = "https://";

    /**
     * 0
     */
    public static final int ZERO = 0;
    /**
     * 1
     */
    public static final int ONE = 1;
    /**
     * 2
     */
    public static final int TWO = 2;
    /**
     * 3
     */
    public static final int THREE = 3;
    /**
     * 4
     */
    public static final int FOUR = 4;
    /**
     * 10
     */
    public static final int TEN = 10;
    /**
     * 100
     */
    public static final int ONE_HUNDRED = 100;
    /**
     * 1000
     */
    public static final int ONE_THOUSAND = 1000;
    /**
     * 499
     */
    public static final int FOUR_HUNDRED_AND_NINETY_NINE = 499;
    /**
     * 码 转成 米
     */
    public static final BigDecimal YARD = new BigDecimal(0.9144);

    /**
     * 税加工费为0时，含税加工费=不含税加工费*1.15
     */
    public static final BigDecimal TAX_PRICE_FORMULA = new BigDecimal(1.15);

    /**
     * 未知
     */
    public static final String UNKNOWN = "未知";

    /**
     * 无
     */
    public static final String NOTHING = "无";

    /**
     * service层事务超时时间
     */
    public static final int TIME_OUT = 999999999;

    /**
     * 逗号
     */
    public static final String COMMA = ",";

    /**
     * 创建时间（排序用）
     */
    public static final String CREATE_TIME = "create_time";

    /**
     * 排序方式（排序用）
     */
    public static final String DESC = "desc";

    /**
     * （排序用）
     */
    public static final String ORDER_BY = " order by ";

    /**
     * （排序用）
     */
    public static final String SPACE = " ";

    /**
     * 分隔符
     */
    public static final String SEPARATOR = "&";

    /**
     * 百分号
     */
    public static final String PER_CENT = "%";

    /**
     * 星
     */
    public static final String STAR = "*";

    /**
     *
     */
    public static final String ZERO_ZERO = "00";

    /**
     * 分号
     */
    public static final String SEMICOLON = ";";

    /**
     * 点
     */
    public static final String DROP = ".";

    /**
     *
     */
    public static final String V_ZERO_ZERO = "V.00";

    public static final String VERSION_STR = "V.";
}
